const mongoose = require('mongoose')

//创建文档结构对象
let ArticleSchema = new mongoose.Schema({
    title: {
        type: String,
        required: true
    },
    content: {
        type: String,
        required: true
    },
    cover_img:String,
    pub_date:String,
    state:{
        type:String,
        default:"草稿箱"
    },
    is_delete:{
        type:Number,
        default:0
    },
    cate_name:{
        type:String,
        required:true
    },
    author_name:String
})

let ArticleModel = mongoose.model('article', ArticleSchema);

module.exports = ArticleModel